package com.m115.m115browser.manager;

import android.R.string;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {
	private static final String DATABASE_NAME = "browser.db";
	private static final int DATABASE_VERSION = 1;

	public DBHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// title,url
		String bookmarkTable = "CREATE TABLE bookmark(title VARCHAR,url VARCHAR)";
		db.execSQL(bookmarkTable);
		// title,url
		String historyTable = "CREATE TABLE history(title VARCHAR,url VARCHAR)";
		db.execSQL(historyTable);
		// filename,status,filepath
		// status:0=downloading,1=download completed,2=download failed
		String downloadTable = "CREATE TABLE download(filename VARCHAR,filepath VARCHAR,status VARCHAR)";
		db.execSQL(downloadTable);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {

	}

}
